package edu.luc.concordia;

/**
 * Copyright 2008 Project Concordia
 * <p>
 * This file is part of RetailReturnSystem.
 * <p>
 * RetailReturnSystem is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * <p>
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * <p>
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.
 * <hr>
 * SE project 
 * PriceScheme class
 * @author Yumin Li 
 * @version 2
 */

public class PriceScheme
{
    // String representation of the pricing scheme
    private String myScheme;
    /**
     * Constructor 
     */
    public PriceScheme( String scheme ) 
    {
        // Initializes myScheme variable with the value of scheme, scheme is the raw scheme input from the XML file 
        myScheme = scheme;
    }
    public double getPrice() 
    {
        //Returns the price for this PriceScheme. In Cycle 1, there will only be ProductPrices. 
        
        return Double.parseDouble( myScheme.substring(2, myScheme.indexOf("N")) ); 
    }
}

